package com.example.auth;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import java.util.UUID;

public class SecretEncoder {


    public static void main(String[] args) {
        encodeUser();
//curl nacos-nacos-server-1:8848/nacos/index.html
        // 输出类似：$2a$10$6BhNv6bwC6B6B6B6B6B6B.6B6B6B6B6B6B6B6B6B6B6B6B6B6B6B
    }

    //encoder.matches("inputPassword", "storedHash")
    public static void encodeUser() {
        String encodedSecret = new BCryptPasswordEncoder().encode("123456");
        String uuid= UUID.randomUUID().toString().replace("-", "");
        System.out.println("UUID: "+uuid);
        System.out.println("encodedSecret: "+encodedSecret);
    }

    public static void encodeClient(){
        String encodedSecret = new BCryptPasswordEncoder().encode("wuzzSecret");
        System.out.println(encodedSecret);
    }
}
